<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">    
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="./css/style.min.css">
    <title>店铺首页</title>
</head>
<script type="text/javascript">
    window.onload=function () {
            document.addEventListener('touchstart',function (event) {
                if(event.touches.length>1){
                    event.preventDefault();
                }
            })
            var lastTouchEnd=0;
            document.addEventListener('touchend',function (event) {
                var now=(new Date()).getTime();
                if(now-lastTouchEnd<=300){
                    event.preventDefault();
                }
                lastTouchEnd=now;
            },false)
        }
</script>

<body>
<div id="index-pg">
    <toast ref="toast"></toast>
</div>
    <script src="./js/lib/vue.js"></script>
    <script src="./js/min/config.min.js"></script>
    <script src="http://static.jdhui.com/lib/vue-resource/1.2/vue-resource.js"></script>
    <script type="text/javascript" src="./js/min/common.min.js"></script>
     <script src="./js/min/component.min.js"></script>
    <script>
    var store_id=APP.getQueryString("storeid");
    if (store_id==""||store_id==null) {
        store_id=APP.getCookie("shopid");
        if (store_id==""||store_id==null) {
            store_id="";
        }
    }
    var loginlink=document.getElementById('loginlink');
    var toast = new component.popup.toast();
    // loginlink.setAttribute("href","login.html?storeid="+store_id);
    Vue.http.options.xhr = {
                withCredentials: true
            }
            Vue.http.options.credentials = true;
    	
    var idxpg=new Vue({
        el: "#index-pg",
        data: {

        },
         component: {
            'toast': toast
        },
        mounted: function () {
            if (store_id==""||store_id==null) {
                this.$refs.toast.show("未定义店铺,请从入口文件进入或添加storeid",5000);
                /*setTimeout(function(){
                    window.location.href="login.html"
                },5000)*/
            }else{
                Vue.http.post(APIPHP + "apic?storeid="+store_id).then(function (_res) {
            console.log(_res.body)
        },function () {
            
        })
            }
        }

    })
    </script>
</body>

</html>
